package com.beiding.jsonanalyzer.analyze;

import com.beiding.jsonanalyzer.querylink.QueryLinkNodeResult;

public interface SortAble {
    QueryLinkNodeResult orderWith(Orderer sorter);

    default QueryLinkNodeResult advOrder(Option<Orderer> option) {
        Orderer orderer = new Orderer();
        option.opt(orderer);
        return orderWith(orderer);
    }

    default QueryLinkNodeResult order(Option<Orderer> option) {
        Orderer orderer = new Orderer().keyMode(KeyMode.TEXT_TO_KEY);
        option.opt(orderer);
        return orderWith(orderer);
    }

}
